#ifndef __BIKIROM_TIMERS__
#define __BIKIROM_TIMERS__

#include "bikirom-ints.h"
#include "Timers.h"

typedef void (*voidFncPtr16)(void*);

typedef struct _typTimers
{
	voidFncPtr16	mFncPtr;								/* Pointer to function to execute */
	int16_t			mFncParam ;								/* Paramater to pass to function */
	uint32_t		mOverflowCnt ;							/* Overflow Counter */
	uint32_t		mOverflowReq;							/* Overflows required to fire */
	uint8_t			mBRecuring:1,							/* Defined a Recuring Timer */
					mRunning:1,								/* If the thread is still running */
					mPriority:6;							/* Defines the prioity level, 1 being highest */
} _typTimers;

// Initialise the timer
void	btimer_init	(uint8_t frequency, uint8_t timer, enum _eTimerInterrupts eInt);

// Add a timer
uint8_t btimer_add	(void (*BikTmrfunc)(void* param), int16_t Paramater, uint32_t Timeout, uint32_t TimeoutOffset, uint8_t Recuring, uint8_t Priority);

// Remove a timer
uint8_t btimer_remove(void (*BikTmrfunc)(void* param));

#endif
